namespace go api

struct ListCounterpartyPermissionRequest {
    1: required i32 pageNum
    2: required i32 pageSize
    3: string sort
    4: CounterpartyPermissionData data
}

struct ListCounterpartyPermissionResponse {
	1: list<CounterpartyPermissionData> data
	2: i64 count
}

struct CounterpartyPermissionData {
	1:i64 id
	2: string created_at,
    3: string updated_at,
    4: i64 created_user_id,
    5: i64 updated_user_id,
    6: i64 organization_id,
    7: string updated_user_nickname,
    8: string created_user_nickname,
	9: i64 counterpartyId
	10: i64 counterpartyContactId
	11: i64 userId
	12: string username
	13: string nickname
	14: i64 permissionType

}

struct BatchDeleteCounterpartyPermissionRequest {
    1: list<i64> ids
}

service CounterpartyPermission {
    ListCounterpartyPermissionResponse listCounterpartyPermission(1: ListCounterpartyPermissionRequest req)
    CounterpartyPermissionData getCounterpartyPermission(1: CounterpartyPermissionData req)
    void addCounterpartyPermission(1: CounterpartyPermissionData req)
    void editCounterpartyPermission(1: CounterpartyPermissionData req)
    void deleteCounterpartyPermission(1: i64 id)
    void batchDeleteCounterpartyPermission(1: BatchDeleteCounterpartyPermissionRequest req)
}